package com.ivanceras.shared.db;

public interface IModelDef {
	
	String getNamespace();
	
	String getModelName();
	
	String[] getAttributes();
	
	String[] getUniqueAttributes();
	
	String[] getPrimaryAttributes();
	
	String[] getDataTypes();
	
	Object[] getValues();
	
	/**
	 * Basically the objects that refer to the foreign key of this table.
	 * @return
	 */
	String[] getHasOne();
	
	String[] getHasOneForeignColumn();

	/**
	 * The primary key of this table is used as a foreign key of the children table
	 * @return
	 */
	String[] getHasMany();

	String[] getHasManyForeignColumn();
	
	/**
	 * This needs a linker table in which the primary of this table will be used to link to other tables
	 * linker table convention will use the table that appears first in the alphabet
	 * @return
	 */
	String[] getHasManyMany();

	String[] getHasManyManyInvolvedModel();

	String[] getHasManyManyInvolvedModelForeignColumn();

	
	void setNamespace(String namespace);
	
	void setModelName(String modelName);
	
	void setAttributes(String[] attribute);
	
	void setUniqueAttributes(String[] uniqueAttribute);
	
	void setPrimaryAttributes(String[] primaryAttribute);
	
	void setDataTypes(String[] dataTypes);
	
	void setValues(Object[] values);
	
	void setHasOne(String[] hasOne);
	
	void setHasOneForeignColumn(String[] hasOneForeignColumn);
	
	void setHasMany(String[] hasMany);
	
	void setHasManyForeignColumn(String[] hasManyForeignColumn);
	
	void setHasManyMany(String[] hasManyMany);

	void setHasManyManyInvolvedModel(String[] hasManyManyInvolvedModel);

	void setHasManyManyForeignColumn(String[] hasManyManyForeignColumn);

	
	String getGeneratedAttribute();
	
	void setGeneratedAttribute(String generatedAttribute);
	
	void setCaseSensitive(boolean caseSensitive);
	
	boolean isCaseSensitive();

	String toSummaryString();

	String getPrimaryColumn();

	String getForeignKeyColumn(String modelName);

	String[] getForeignKeyColumns(String modelName);

	String[] getPrimaryColumns();

}
